package businesslogic.Updatebl;

import VO.OrderInfoVO;
import businesslogic.Orderbl.AddAnOrderController;
import businesslogic.Orderbl.ExecutionController;
import service.OrderService.AddAnOrderService;
import service.OrderService.ExecutionService;
import util.Message;

/**
 * Created by insomnia on 2016/11/17.
 * 订单信息方法的具体实现
 * @author insomnia
 */
public class Order {
    /**持有AddAnOrderByUpdate和ExecutionByUpdate的引用*/
    private AddAnOrderByUpdate addAnOrder;
    private ExecutionByUpdate changeOrder;
    /**构造函数*/
    public Order(){
        try{
            addAnOrder=new AddAnOrderController();
            changeOrder=new ExecutionController();
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    /***
     * 添加新的线下订单，调用同层接口
     * @param orderInfo
     * @return 是否成功添加，或相应错误
     */
    public Message addOfflineOrder(OrderInfoVO orderInfo) {
        return addAnOrder.addOrder(orderInfo);
    }

    /***
     * 更新入住时间，调用同层接口
     * @param orderID
     * @param actualTime
     * @return 是否成功更新，或相应错误
     */
    public Message updateActualTime(String orderID,String actualTime) {
        return changeOrder.changeOrder(orderID ,actualTime);
    }
}
